## Script (Python) "isDefaultPassword"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=matricule
##title=
##

# controler le mot de passe
records = container.get_eleves_by_code(cd_cli=matricule)
if records :
   record = records[0]
   # calculate the old style default password
   default_pwd = str(record.cd_cli * 10 + record.agence)
   if record.motdepasse == default_pwd  : 
      # old style password never been modified
      return 1

# password has been modified
return 0


